#ifndef __FACTORY_H__
#define __FACTORY_H__
#include"head.h"
#include"que.h"
//该线程的锁，条件变量，当前状态，线程PID
typedef struct
{
    int new_fd;
    char addr[128];

    pQue_t que;
    int order;

    char start[128];
    char before[128];
    char local[128];

    char buf[1024];

    pthread_cond_t cond;
    pthread_mutex_t mutex;
    pthread_t pthid;
}tNode_t,*ptNode_t;

typedef struct
{
    //队列挂所有客户的消息
    Que_t que;
    //每个线程管一个客户
    ptNode_t pthread;
    int threadNum;
}Fac_t,*pFac_t;

int factory_init(pFac_t,int);
int factory_start(pFac_t,int,int);

int tcp_init(int *,char*,char*);

#endif